<%@ page language="java" import="java.util.List" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>保单查询</title>
<link href="../style/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" href="../style/style.css" />
<script type="text/javascript" src="../Scripts/jquery.js"></script>
<script type="text/javascript">
	function changeCategory()
	{
		var category = document.getElementById("category").value;
		var category1 = document.getElementById("category1");
		var category2 = document.getElementById("category2");
		if(category == '1') {
			category1.style.display="";
		} else {
			category1.style.display="none";
		}
		if(category == '2')	{
			category2.style.display="";
		} else {
			category2.style.display="none";
		}
	}
	
	function gotoPage(page)
	{
		if(page == 0)
		{
			searchPolicyForm.pageNumber.value = document.getElementById("t_pageNumber").value;
			searchPolicyForm.pageSize.value = document.getElementById("t_pageSize").value;
		}
		else
		{
			searchPolicyForm.pageNumber.value = page;
		}
		searchPolicyForm.submit();
	}
	function printdiv(printpage)
{
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print(); 
document.body.innerHTML = oldstr;
return false;
}	
</script>
</head>
<body>

<table width="1000" align="center" cellpadding="0" cellspacing="0" class="table">
  <tr>
    <td>
      <table width="100%"  cellpadding="0" cellspacing="0" class="table2">
        <tr>
          <td valign="top">
            <table width="100%" class="top" cellpadding="0" cellspacing="0">
              <tr>
                <td>当前位置:&nbsp;工资管理&nbsp;&gt;&gt;&nbsp;保单查询</td>
              </tr>
            </table>
			<div id="mainareacontent">
        <div class="mainarea">
        
        <s:form action="wage!showPolicyList" method="post" theme="simple" id="searchPolicyForm">
            <div class="search">			
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td align="left" >
                        <table cellpadding="0" cellspacing="0" border="0" width="100%"  style=" display:block">
                        <tr>
                          <td width="70"> 查询类型： </td>
                          <td width="150" align="left">
                          	<s:select id="category" name="category" list="#{'0':'按年份','1':'按月份','2':'按季度'}" 
                            			listKey="key" listValue="value" onchange="javascript:changeCategory();">
                            </s:select>
                          </td>
                          <td width="70" align="left"> 员工编号： </td>
                          <td width="150" align="left">
                              <s:textfield name="employeeId" />
                          </td>
                          <td width="70"> 选择年份： </td>
                          <td width="150" align="left">
                              <s:select name="year" list="#{'2011':'2011年','2010':'2010年','2009':'2009年','2008':'2008年'}" listKey="key" listValue="value" />
                          </td>
                          <td>
                          	<div id="category1" style="display: none">
                              选择月份：
                              <s:select name="month" list="#{'1':'1 月','2':'2 月','3':'3 月','4':'4 月','5':'5 月','6':'6 月','7':'7 月','8':'8 月','9':'9 月','10':'10月','11':'11月','12':'12月'}" listKey="key" listValue="value" />
                          	</div>
                          	<div id="category2" style="display: none">
                              选择季度：
                              <s:select name="season" list="#{'1':'第1季度','2':'第2季度','3':'第3季度','4':'第4季度'}" listKey="key" listValue="value" />
                          	</div>
                          </td>
                          <td width="70" align="left" >
                          	<img src="../images/btn_search.gif" onclick="document.getElementById('searchPolicyForm').submit();"/>&nbsp;<input type="button" style="width:40px; height:20px; font-size:12px; background-color: #E5F1FF" onClick="printdiv('dy');" value="打 印"/> 
                          </td>
                        </tr>
                        <tr></tr>
                      </table>
                    </td>
                    </tr>
                </table>
            </div>
                <s:hidden id="pageNumber" name="page.pageNumber"></s:hidden>
                <s:hidden id="pageSize" name="page.pageSize"></s:hidden>
		</s:form>

             <table width="100%" cellpadding="0" cellspacing="0"class="table3">
                 <tr >
                     <td height="25" width="6%" class="title">&nbsp;</td>
                     <td width="6%" align="left" >标准总保费和：</td>
                     <td width="5%" align="left" ><s:property value="totalSum" default="0.00" /></td>
                     <td width="5%" >&nbsp;</td>
                     <td width="5%" >保单总数：</td>
                     <td width="5%" ><s:property value="totalAmount" default="0" /></td>
                     <td width="5%" ></td>  
                     <td width="18%" ></td>
                     <td width="14%" >&nbsp;</td>
                 </tr>
             </table>

            <table width="100%" cellpadding="0" cellspacing="1" class="dg_borderstyle">
              <thead>
               <div id="dy">
                <tr>
                  <th width="32" height="52">&nbsp;</th>
                  <th width="69">保单编号</th>
                  <th width="96">员工编号</th>
                  <th width="72">客户名称</th>
                  <th width="130">保险公司</th>
                  <th width="68">保险险种</th>
                  <th width="60">标准总保费</th>
                  <th width="70">是否是续保 </th>
                  <th width="80">投保日期</th>
                </tr>
              </thead>
              <tbody>
              	<s:iterator value="#request.policyList" status="st" id="clientList">
                <tr align="center">
                  <td><input type="radio" name="policys" value="<s:property value='policyId'/>" /></td>
                  <td><s:property value="policyId"/></td>
                  <td><s:property value="employee.employeeId"/></td>
                  <td><s:property value="client.clientName"/></td>
                  <td><s:property value="insurancedef.subcompany.sshortName"/></td>
                  <td><s:property value="insurancedef.insurancetype.insuranceName"/></td>
                  <td><s:property value="sumFee"/></td>
                  <td><s:property value="isCountinue"/></td>
                  <td><s:date name="insuranceDate" format="yyyy-MM-dd"/></td>
                </tr>
                </s:iterator>
              </tbody>
              </div>
            </table>
            
            <table width="100%" cellpadding="0" cellspacing="0" class="dg_pagestyle">
                <tr>
                    <td class="pageinfo">
                        	第<s:property value="page.pageNumber"/>页 | 共<s:property value="page.totalPage"/>页
                    </td>
                    <td class="pagebutton">
                        每页
                        <s:select id="t_pageSize" name="page.pageSize" list="{'10','20','30','40','50'}" theme="simple">
                        </s:select>
                        条记录 | 第
                        <s:textfield id="t_pageNumber" name="page.pageNumber" cssStyle="width: 20px;" theme="simple" />
                        页
                        <a onclick="javascript:gotoPage(0);" href="javascript:void(0);">
                        	<img src="../images/btn_go.gif" />
                        </a>
                        <a onclick="javascript:gotoPage(1);" href="javascript:void(0);">
                        	<img src="../images/btn_sy.gif" width="55" height="20" />
                        </a>
                        <a onclick="javascript:gotoPage(<s:property value='page.prePage' />);" 
                        		href="javascript:void(0);">
                        	<img src="../images/btn_syy.gif" width="55" height="20" />
                        </a>
                        <a onclick="javascript:gotoPage(<s:property value='page.nextPage' />);" 
                        		href="javascript:void(0);">
                        	<img src="../images/btn_xyy.gif" width="55" height="20" />
                        </a>
                        <a onclick="javascript:gotoPage(<s:property value='page.lastPage' />);" 
                        		href="javascript:void(0);">
                        	<img src="../images/btn_wy.gif" width="55" height="20" />
                        </a>
                    </td>
                </tr>
            </table>
          </div>
         </div>
         </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<script type="text/javascript">
	changeCategory();
</script>
</body>
</html>